<% if !@content_ver_id.nil? %>
	<h2><%= params[:case] %> Article</h2>
<% else %>
	<h2><%=@do%></h2>
<% end %>

<script type="text/javascript">	
	function showData(obj) {
		document.getElementById("title").innerHTML = obj.rows[obj.rowIndex].cells[1].innerHTML ;
	}
</script>


<p>
<div>
	<% form_tag( { :controller => "content", :action => "manage_article", :id => params[:id], :page => params[:page] }, :method => "post") do %>
		<table>
			<tr>
				<td>Category</td>
				<td>
					<% if !@content_ver_id.nil? %>
						<%= select_tag(:selCategory, options_from_collection_for_select(@categories, "id", "name", @content_edit.category_id.to_i)) %>
					<% else %>
						<%= select_tag(:selCategory, options_from_collection_for_select(@categories, "id", "name")) %>
					<% end %>
				</td>
			</tr>
			<tr>
				<td><%=@title%></td>
				<td>
					<% if !@content_ver_id.nil? %>
						<%= text_field_tag :title, @content_edit.title, :size => ContentVersion::SUBJECT_SIZE, :maxlength => ContentVersion::SUBJECT_MAX_LENGTH %>
					<% else %>
						<%= text_field_tag :title, "", :size => ContentVersion::SUBJECT_SIZE, :maxlength => ContentVersion::SUBJECT_MAX_LENGTH %>
					<% end %>
				</td>
			</tr>
			<tr>
				<td><%=@body%></td>
				<td>
					<% if !@content_ver_id.nil? %>
						<%= text_area_tag :body, @content_edit.body, :rows => 10, :cols => 80 %>
					<% else %>
						<%= text_area_tag :body, "", :rows => 10, :cols => 80 %>
					<% end %>
				</td>
			</tr>
			<tr>
				<td></td>
				<td>
					<%= submit_tag("Save", :name => "save") %>
					<% if (params[:case] == "Edit") || (params[:case] == "Delete") %>
						<%= submit_tag("Undo", :name => "undo") %>
					<% end %>
				</td>
			</tr>
		</table>
		
		<% if !@content_ver_id.nil? %>
			<%= hidden_field_tag :hidCase, params[:case] %>
			<%= hidden_field_tag :hidConRawID, @content_edit.content_raw_id %>
			<%= hidden_field_tag :hidConVerID, @content_ver_id %>
		<% end %>
	<% end %>	
</div>
</p>

<p>
<div id="table_content">
	<%= render :partial => "contents_manage" %>
</div>
</p>

<p>
<div>
<%= will_paginate @contents, :params => { :id => params[:id] } %>
</div>
</p>
